package com.his.his_system.controller.DataStatisticsController;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.his.his_system.domain.DzmHisCarePkg;
import com.his.his_system.domain.Workload;
import com.his.his_system.service.impl.WorkloadServiceImpl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 工作量统计
 */
@RestController
@RequestMapping("workload")
public class WorkloadStatisticsController {


      //设置分页条数


      private static  final  int PAGE_SIZE =6;


      @Resource
      private WorkloadServiceImpl workloadService;

      /**
       * 获取全部工作量
       */

      @GetMapping("getAll")
      PageInfo<Workload> getAll(Integer pageNum){


            PageHelper.startPage(pageNum,PAGE_SIZE);

            PageInfo<Workload> page = new PageInfo<Workload>(workloadService.getAll());


            return  page;

      }


      /**
       * 医生姓名查询
       */



      @GetMapping("queryDoctor")
      PageInfo<Workload> queryDoctor(String doctorname,Integer pageNum){

            PageHelper.startPage(pageNum,PAGE_SIZE);

            PageInfo<Workload> page = new PageInfo<Workload>(workloadService.queryDoctor(doctorname));


            return page;

      }




}
